<%--
    Created by IntelliJ IDEA.
    User: Re
--%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title>主页</title>
</head>
<body>
<form action="addShopCart" method="post">
    <input type="hidden" name="userId" value="${user.userId}">
    <table border="1">
        <tr>
            <th>商品名</th>
            <th>商品价格</th>
            <th>加入购物车</th>
            <th>购买</th>
        </tr>
        <c:forEach items="${commodityListMsg}" var="commodity">
            <tr>
                <td>${commodity.commodityName}</td>
                <td>${commodity.commodityPrice}</td>
                <td><button type="submit" name="collect" value="${commodity.commodityId}">加入购物车</button></td>
                <td><button type="submit" name="buy" value="${commodity.commodityId}">购买</button> </td>
            </tr>
        </c:forEach>
    </table >
    <button type="submit" name="intoCollect" value="intoCollect">进入购物车</button>
    <button type="submit" name="intoOrder" value="intoOrder">进入订单页</button><br>
    <button type="submit" name="homepage" value="homepage">个人主页</button>
    <span style="color: red;font-size: 15px">${msg}</span>
</form>
</body>
</html>
